#include "../src/common.h"

using namespace xege;
int main () {

	SDL_Event gEvent;
	POINT mouse {0};
	bool windowIsRun = true;

	WINDOW win (800, 600);
	char* s = new char [256];
	IMAGE hover (win, "./res/button/HOVER.jpg");
	IMAGE pressed (win, "./res/button/PRESSED.jpg");
	IMAGE released (win, "./res/button/RELEASED.jpg");
	// IMAGE click (win, "./res/button/CLICK.png");
	BUTTON button (win, 300, 200, &hover, &pressed, &released);
	// BUTTON button (win, 300, 200, 100, 30);
	while (windowIsRun) {
		// while (SDL_PollEvent (&gEvent)) {
			switch (SDL_PollEvent (&gEvent); gEvent.type) {
			case SDL_QUIT: windowIsRun = false; SDL_Quit (); break;
			case SDL_MOUSEBUTTONDOWN:  break;
			case SDL_MOUSEBUTTONUP:  break;
			// case sdl
			default: break;
			}


			SDL_GetMouseState (&mouse.x, &mouse.y);
			// SDL_Log ("x: %4d\ny: %4d", x, y);
			sprintf (s, "x: %4d  y: %4d", mouse.x, mouse.y);
			button.show (&gEvent);
			win.updateTexture ();
			win.drawString (10, 10, s);
			win.drawCircle (100, 100, 20);
			win.drawFillCircle (100, 200, 40, YELLOW);
			win.update ();
			SDL_Delay (5.0/60);
			win.clear ();
		// }
	}

	return 0;
}